package com.tjec.project.system.service.impl;

import java.util.List;
import com.tjec.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.tjec.project.system.mapper.BmsAttachmentHistoryMapper;
import com.tjec.project.system.domain.BmsAttachmentHistory;
import com.tjec.project.system.service.IBmsAttachmentHistoryService;

/**
 * 文件历史版本Service业务层处理
 * 
 * @author tjec
 * @date 2020-04-17
 */
@Service
public class BmsAttachmentHistoryServiceImpl implements IBmsAttachmentHistoryService 
{
    @Autowired
    private BmsAttachmentHistoryMapper bmsAttachmentHistoryMapper;

    /**
     * 查询文件历史版本
     * 
     * @param id 文件历史版本ID
     * @return 文件历史版本
     */
    @Override
    public BmsAttachmentHistory selectBmsAttachmentHistoryById(String id)
    {
        return bmsAttachmentHistoryMapper.selectBmsAttachmentHistoryById(id);
    }

    /**
     * 查询文件历史版本列表
     * 
     * @param attachId 文件id
     * @return 文件历史版本
     */
    @Override
    public List<BmsAttachmentHistory> selectBmsAttachmentHistoryList(BmsAttachmentHistory bmsAttachmentHistory)
    {
        return bmsAttachmentHistoryMapper.selectBmsAttachmentHistoryList(bmsAttachmentHistory);
    }

    /**
     * 新增文件历史版本
     * 
     * @param bmsAttachmentHistory 文件历史版本
     * @return 结果
     */
    @Override
    public int insertBmsAttachmentHistory(BmsAttachmentHistory bmsAttachmentHistory)
    {
        bmsAttachmentHistory.setCreateTime(DateUtils.getNowDate());
        return bmsAttachmentHistoryMapper.insertBmsAttachmentHistory(bmsAttachmentHistory);
    }

    /**
     * 修改文件历史版本
     * 
     * @param bmsAttachmentHistory 文件历史版本
     * @return 结果
     */
    @Override
    public int updateBmsAttachmentHistory(BmsAttachmentHistory bmsAttachmentHistory)
    {
        bmsAttachmentHistory.setUpdateTime(DateUtils.getNowDate());
        return bmsAttachmentHistoryMapper.updateBmsAttachmentHistory(bmsAttachmentHistory);
    }

    /**
     * 批量删除文件历史版本
     * 
     * @param ids 需要删除的文件历史版本ID
     * @return 结果
     */
    @Override
    public int deleteBmsAttachmentHistoryByIds(String[] ids)
    {
        return bmsAttachmentHistoryMapper.deleteBmsAttachmentHistoryByIds(ids);
    }

    /**
     * 删除文件历史版本信息
     * 
     * @param id 文件历史版本ID
     * @return 结果
     */
    @Override
    public int deleteBmsAttachmentHistoryById(String id)
    {
        return bmsAttachmentHistoryMapper.deleteBmsAttachmentHistoryById(id);
    }
}
